import scrapy
import urllib
import re


class jianshuSpider(scrapy.Spider):
    handle_httpstatus_list = [404, 500, 403]
    name = "jianshu"
    allowed_domains = ['jianshu.com']
    start_urls = ['http://blog.csdn.net/ioiol/article/details/47112853', ]

    def parse(self, response):
        print "--------------status code :"+str(response.status)
        filename = response.url.split("/")[-1]
        with open(filename, 'wb') as f:
            f.write(response.body)
